home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 1 / Atari Mega Archive - Volume 1.iso / program / rcs5ap1s.lzh / RCSBASE.H < prev    next >
C/C++ Source or Header  |  1991-01-30  |  25KB  |  898 lines

  1.  
  2. /*
  3.  *                     RCS common definitions and data structures
  4.  */
  5. #define RCSBASE "$Id: rcsbase.h,v 5.7 1991/01/30 14:21:32 apratt Exp $"
  6.  
  7. /* Copyright (C) 1982, 1988, 1989 Walter Tichy
  8.    Copyright 1990 by Paul Eggert
  9.    Distributed under license by the Free Software Foundation, Inc.
  10.  
  11. This file is part of RCS.
  12.  
  13. RCS is free software; you can redistribute it and/or modify
  14. it under the terms of the GNU General Public License as published by
  15. the Free Software Foundation; either version 1, or (at your option)
  16. any later version.
  17.  
  18. RCS is distributed in the hope that it will be useful,
  19. but WITHOUT ANY WARRANTY; without even the implied warranty of
  20. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  21. GNU General Public License for more details.
  22.  
  23. You should have received a copy of the GNU General Public License
  24. along with RCS; see the file COPYING.  If not, write to
  25. the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
  26.  
  27. Report problems and direct all questions to:
  28.  
  29.     rcs-bugs@cs.purdue.edu
  30.  
  31. */
  32.  
  33.  
  34.  
  35. /*****************************************************************************
  36.  * INSTRUCTIONS:
  37.  * =============
  38.  * See the Makefile for how to define C preprocessor symbols.
  39.  * If you need to change the comment leaders, update the table comtable[]
  40.  * in rcsfnms.c. (This can wait until you know what a comment leader is.)
  41.  *****************************************************************************
  42.  */
  43.  
  44.  
  45. /* $Log: rcsbase.h,v $
  46.  * Revision 5.7  1991/01/30  14:21:32  apratt
  47.  * CI with RCS version 5
  48.  *
  49.  * Revision 5.6  91/01/11  12:46:18  apratt
  50.  * First version that compiles.
  51.  * 
  52.  * Revision 5.5  90/12/04  05:18:43  eggert
  53.  * checked in with -k by apratt at 91.01.10.13.15.06.
  54.  * 
  55.  * Revision 5.5  1990/12/04  05:18:43  eggert
  56.  * Use -I for prompts and -q for diagnostics.
  57.  *
  58.  * Revision 5.4  1990/11/01  05:03:35  eggert
  59.  * Don't assume that builtins are functions; they may be macros.
  60.  * Permit arbitrary data in logs.
  61.  *
  62.  * Revision 5.3  1990/09/26  23:36:58  eggert
  63.  * Port wait() to non-Posix ANSI C hosts.
  64.  *
  65.  * Revision 5.2  1990/09/04  08:02:20  eggert
  66.  * Don't redefine NAME_MAX, PATH_MAX.
  67.  * Improve incomplete line handling.  Standardize yes-or-no procedure.
  68.  *
  69.  * Revision 5.1  1990/08/29  07:13:53  eggert
  70.  * Add -kkvl.  Fix type typos exposed by porting.  Clean old log messages too.
  71.  *
  72.  * Revision 5.0  1990/08/22  08:12:44  eggert
  73.  * Adjust ANSI C / Posix support.  Add -k, -V, setuid.  Don't call access().
  74.  * Remove compile-time limits; use malloc instead.
  75.  * Ansify and Posixate.  Add support for ISO 8859.
  76.  * Remove snoop and v2 support.
  77.  *
  78.  * Revision 4.9  89/05/01  15:17:14  narten
  79.  * botched previous USG fix 
  80.  * 
  81.  * Revision 4.8  89/05/01  14:53:05  narten
  82.  * changed #include <strings.h> -> string.h for USG systems.
  83.  * 
  84.  * Revision 4.7  88/11/08  15:58:45  narten
  85.  * removed defs for functions loaded from libraries
  86.  * 
  87.  * Revision 4.6  88/08/09  19:12:36  eggert
  88.  * Shrink stdio code size; remove lint; permit -Dhshsize=nn.
  89.  * 
  90.  * Revision 4.5  87/12/18  17:06:41  narten
  91.  * made removed BSD ifdef, now uses V4_2BSD
  92.  * 
  93.  * Revision 4.4  87/10/18  10:29:49  narten
  94.  * Updating version numbers
  95.  * Changes relative to 1.1 are actually relative to 4.2
  96.  * 
  97.  * Revision 1.3  87/09/24  14:02:25  narten
  98.  * changes for lint
  99.  * 
  100.  * Revision 1.2  87/03/27  14:22:02  jenkins
  101.  * Port to suns
  102.  * 
  103.  * Revision 4.2  83/12/20  16:04:20  wft
  104.  * merged 3.6.1.1 and 4.1 (SMALLOG, logsize).
  105.  * moved setting of STRICT_LOCKING to Makefile.
  106.  * changed DOLLAR to UNKN (conflict with KDELIM).
  107.  * 
  108.  * Revision 4.1  83/05/04  09:12:41  wft
  109.  * Added markers Id and RCSfile.
  110.  * Added Dbranch for default branches.
  111.  * 
  112.  * Revision 3.6.1.1  83/12/02  21:56:22  wft
  113.  * Increased logsize, added macro SMALLOG.
  114.  * 
  115.  * Revision 3.6  83/01/15  16:43:28  wft
  116.  * 4.2 prerelease
  117.  * 
  118.  * Revision 3.6  83/01/15  16:43:28  wft
  119.  * Replaced dbm.h with BYTESIZ, fixed definition of rindex().
  120.  * Added variants of NCPFN and NCPPN for bsd 4.2, selected by defining V4_2BSD.
  121.  * Added macro DELNUMFORM to have uniform format for printing delta text nodes.
  122.  * Added macro DELETE to mark deleted deltas.
  123.  *
  124.  * Revision 3.5  82/12/10  12:16:56  wft
  125.  * Added two forms of DATEFORM, one using %02d, the other %.2d.
  126.  *
  127.  * Revision 3.4  82/12/04  20:01:25  wft
  128.  * added LOCKER, Locker, and USG (redefinition of rindex).
  129.  *
  130.  * Revision 3.3  82/12/03  12:22:04  wft
  131.  * Added dbm.h, stdio.h, RCSBASE, RCSSEP, RCSSUF, WORKMODE, TMPFILE3,
  132.  * PRINTDATE, PRINTTIME, map, and ctab; removed Suffix. Redefined keyvallength
  133.  * using NCPPN. Changed putc() to abort on write error.
  134.  *
  135.  * Revision 3.2  82/10/18  15:03:52  wft
  136.  * added macro STRICT_LOCKING, removed RCSUMASK.
  137.  * renamed JOINFILE[1,2] to JOINFIL[1,2].
  138.  *
  139.  * Revision 3.1  82/10/11  19:41:17  wft
  140.  * removed NBPW, NBPC, NCPW.
  141.  * added typdef int void to aid compiling
  142.  */
  143.  
  144. /* GCC */
  145. #if __GNUC__ && !__STRICT_ANSI__
  146. #    define exiting volatile
  147. #else
  148. #    define exiting
  149. #endif
  150.  
  151.  
  152. /* standard include files */
  153.  
  154. #include "conf.h"
  155.  
  156. #if !MAKEDEPEND
  157.  
  158. #include <errno.h>
  159. #include <signal.h>
  160. #include <time.h>
  161.  
  162.  
  163. /* AKP: set ANSI_INCLUDE_FILES to 1 in conf.h if you have them. */
  164.  
  165. #if !ANSI_INCLUDE_FILES
  166.  
  167. /* ANSI C library */
  168. /* These declarations are for the benefit of non-ANSI C hosts.  */
  169.  
  170.     /* <errno.h> */
  171. #    ifndef errno
  172.         extern int errno;
  173. #    endif
  174.  
  175.     /* <limits.h> */
  176. #    ifndef CHAR_BIT
  177. #        define CHAR_BIT 8
  178. #    endif
  179. #    ifndef ULONG_MAX
  180. #        define ULONG_MAX (-(unsigned long)1)
  181. #    endif
  182.  
  183.     /* <signal.h> */
  184. #    ifndef signal
  185.         signal_type (*signal P((int,signal_type(*)P((int)))))P((int));
  186. #    endif
  187.  
  188.     /* <stdio.h> */
  189.     /* conf.h declares the troublesome printf family.  */
  190. #    ifndef L_tmpnam
  191. #        define L_tmpnam 25 /* sizeof("/usr/tmp/xxxxxxxxxxxxxxx") */
  192. #    endif
  193. #    ifndef SEEK_SET
  194. #        define SEEK_SET 0
  195. #    endif
  196. #    ifndef fopen
  197.         FILE *fopen P((const char*,const char*));
  198. #    endif
  199. #    ifndef fread
  200.         fread_type fread P((void*,size_t,size_t,FILE*));
  201. #    endif
  202. #    ifndef fwrite
  203.         fread_type fwrite P((const void*,size_t,size_t,FILE*));
  204. #    endif
  205. #    ifndef fclose
  206.         int fclose P((FILE*));
  207. #    endif
  208. #    ifndef fflush
  209.         int fflush P((FILE*));
  210. #    endif
  211. #    ifndef fputs
  212.         int fputs P((const char*,FILE*));
  213. #    endif
  214. #    ifndef fseek
  215.         int fseek P((FILE*,long,int));
  216. #    endif
  217. #    ifndef perror
  218.         void perror P((const char*));
  219. #    endif
  220. #    ifndef clearerr
  221.         void clearerr P((FILE*));
  222. #    endif
  223. #    ifndef feof
  224.         int feof P((FILE*));
  225. #    endif
  226. #    ifndef ferror
  227.         int ferror P((FILE*));
  228. #    endif
  229. #    if has_rename && !defined(rename)
  230.         int rename P((const char*,const char*));
  231. #    endif
  232. #    if has_tmpnam && !defined(tmpnam)
  233.         char *tmpnam P((char*));
  234. #    endif
  235.  
  236.     /* <stdlib.h> */
  237. #    ifndef EXIT_FAILURE
  238. #        define EXIT_FAILURE 1
  239. #    endif
  240. #    ifndef EXIT_SUCCESS
  241. #        define EXIT_SUCCESS 0
  242. #    endif
  243. #    ifndef getenv
  244.         char *getenv P((const char*));
  245. #    endif
  246. #    ifndef exit
  247.         exiting exit_type exit P((int));
  248. #    endif
  249. #    ifndef _exit
  250.         exiting underscore_exit_type _exit P((int));
  251. #    endif
  252. #    ifndef free
  253.         free_type free P((malloc_type));
  254. #    endif
  255. #    ifndef atoi
  256.         int atoi P((const char*));
  257. #    endif
  258. #    ifndef malloc
  259.         malloc_type malloc P((size_t));
  260. #    endif
  261. #    ifndef realloc
  262.         malloc_type realloc P((malloc_type,size_t));
  263. #    endif
  264.  
  265.     /* <string.h> */
  266. #    ifndef strcat
  267.         char *strcat P((char*,const char*));
  268. #    endif
  269. #    ifndef strcpy
  270.         char *strcpy P((char*,const char*));
  271. #    endif
  272. #    ifndef strncpy
  273.         char *strncpy P((char*,const char*,int));
  274. #    endif
  275. #    ifndef strrchr
  276.         char *strrchr P((const char*,int));
  277. #    endif
  278. #    ifndef strcmp
  279.         int strcmp P((const char*,const char*));
  280. #    endif
  281. #    ifndef strncmp
  282.         int strncmp P((const char*,const char*,int));
  283. #    endif
  284. #    ifndef strlen
  285.         strlen_type strlen P((const char*));
  286. #    endif
  287.  
  288.     /* <time.h> */
  289. #    ifndef time
  290.         time_t time P((time_t*));
  291. #    endif
  292.  
  293. /* end if !ANSI_INCLUDE_FILES */
  294. #endif
  295.  
  296. /* Posix 1003.1-1988 */
  297. /* These declarations are for the benefit of non-Posix hosts.  */
  298.  
  299.     /* <limits.h> */
  300. #    if !defined(NAME_MAX) && !defined(_POSIX_NAME_MAX)
  301. #        if has_sys_dir_h
  302. #            include